from django.db import models
from django.conf import settings

_ = lambda s: s

# The choices for state of an Object
STATE_CHOICES = getattr(settings, 'STATE_CHOICES', (
    ('1', _('Draft')),
    ('2', _('Published')),
    ('3', _('Inactive')),
))

# The default state when an Object
STATE_DEFAULT = getattr(settings, 'STATE_DEFAULT', '3')

# The state of a Published Object
STATE_PUBLISHED = getattr(settings, 'STATE_PUBLISHED', '2')

class PublishedManager(models.Manager):

    def published(self):
        return self.filter(state=STATE_PUBLISHED)
